package com.wx.chapter10.final_.innerclass;

/**
 * ClassName:InnerClassExercise02
 * Package :com.wx.chapter10.final_.innerclass
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/11 - 18:36
 */
public class InnerClassExercise02 {
    public static void main(String[] args) {
        Cellphone cellphone = new Cellphone();
        cellphone.alarmClock(new Bell() {
            @Override
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });
        cellphone.alarmClock(new Bell() {
            @Override
            public void ring() {
                System.out.println("小伙伴上课了");
            }
        });
    }
}

interface Bell {//铃声接口
    void ring();
}

class Cellphone {
    public void alarmClock(Bell bell) {
        bell.ring();
    }
}